package com.acwing.partition20;

import java.io.*;
import java.util.Map;
import java.util.TreeMap;

/**
 * @author `RKC`
 * @date 2022/1/14 20:02
 */
public class AC1952金发姑娘和N头牛 {

    private static final int N = 20010, INF = 0x3f3f3f3f;
    private static int n = 0, x = 0, y = 0, z = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] s = reader.readLine().split("\\s+");
        n = Integer.parseInt(s[0]);
        x = Integer.parseInt(s[1]);
        y = Integer.parseInt(s[2]);
        z = Integer.parseInt(s[3]);
        Map<Integer, Integer> map = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            s = reader.readLine().split("\\s+");
            //(-INF, left) -> x；[left, right] -> y；(right, INF) -> z
            int left = Integer.parseInt(s[0]), right = Integer.parseInt(s[1]);
            map.put(-INF, map.getOrDefault(-INF, 0) + x);
            map.put(left - 1, map.getOrDefault(left - 1, 0) + y - x);
            map.put(right, map.getOrDefault(right, 0) + z - y);
            map.put(INF, map.getOrDefault(INF, 0) - z);
        }
        int answer = 0, sum = 0;
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            sum += entry.getValue();
            answer = Math.max(answer, sum);
        }
        writer.write(answer + "\n");
        writer.flush();
    }
}
